package cn.hinglo.gameclaw.admin.dao;

import cn.hinglo.gameclaw.data.dbdao.MyMapper;
import cn.hinglo.gameclaw.user.bean.Claw;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

import java.util.Date;
import java.util.List;
import java.util.Map;

/**
 * @createTime: 2017/12/29
 * @author: HingLo
 * @description: 娃娃机管理数据层
 */
@Repository
public interface ClawDao extends MyMapper<Claw> {

    /**
     * 大神榜查询
     *
     * @param start 开始时间
     * @param end   结束时间
     * @return
     */
    @Select("SELECT gn.user_id as userId,ui.header,nike_name as nikeName,COUNT(gn.user_id) as num from user_info as ui RIGHT JOIN  grab_note as gn on ui.user_id=gn.user_id and date between #{start} and #{end} and gn.status=true GROUP BY gn.user_id  ORDER BY num desc LIMIT 100")
    List<Map<String, Object>> okamiListDao(@Param("start") Date start, @Param("end") Date end);

}
